package GUI;

import java.awt.Color;
import java.awt.Font;
import java.util.ArrayList;

import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.border.LineBorder;

import DBConnection.SQL_Abfragen;

public abstract class GrundVorlageKunde extends JPanel {
	JTextField tfGeb;
	JTextField tfEmailGesch;
	JTextField tfEmailPriv;
	JTextField tfMobil;
	JTextField tfTelgesch;
	JTextField tfTelPrvt;
	JTextField tfName;
	JTextField tfVorname;
	JTextField tfAnrede;
	JTextField tfPreis;
	JTextField tfOrt;
	JTextField tfPLZ;
	JTextField tfNr;
	JTextField tfStr;
	JTextField tfLand;
	
	JComboBox comboBoxstatus;
	JComboBox comboBoxaktivitaet;
	
	JTextPane tpLetzterKontakt;
	JTextPane tpSonstiges;
	JTextPane tpStatus;
	
	
	
	public void init() {

		setBorder(new LineBorder(new Color(0, 0, 0)));
		setLayout(null);
		JLabel lblObjekt = new JLabel("Kontaktdaten");
		lblObjekt.setFont(new Font("Lucida Sans", Font.BOLD, 12));
		lblObjekt.setBounds(10, 23, 150, 14);
		add(lblObjekt);
		
		JLabel lblVorname = new JLabel("Vorname");
		lblVorname.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblVorname.setBounds(10, 80, 54, 14);
		add(lblVorname);
		
		tfVorname = new JTextField();
		tfVorname.setColumns(10);
		tfVorname.setBounds(120, 80, 140, 20);
		add(tfVorname);
		
		JLabel lblName = new JLabel("Name");
		lblName.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblName.setBounds(10, 110, 46, 14);
		add(lblName);
		
		tfName = new JTextField();
		tfName.setColumns(10);
		tfName.setBounds(120, 110, 140, 20);
		add(tfName);
		
		JLabel lblTelPrvt = new JLabel("Telefon Privat");
		lblTelPrvt.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblTelPrvt.setBounds(10, 190, 114, 14);
		add(lblTelPrvt);
		
		tfTelPrvt = new JTextField();
		tfTelPrvt.setColumns(10);
		tfTelPrvt.setBounds(120, 190, 140, 20);
		add(tfTelPrvt);
		
		JLabel lblTelgesch = new JLabel("Telefon gesch\u00E4ftlich");
		lblTelgesch.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblTelgesch.setBounds(10, 220, 114, 14);
		add(lblTelgesch);
		
		tfTelgesch = new JTextField();
		tfTelgesch.setColumns(10);
		tfTelgesch.setBounds(120, 220, 140, 20);
		add(tfTelgesch);
		
		JLabel lblEmailPriv = new JLabel("E-Mail Privat");
		lblEmailPriv.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblEmailPriv.setBounds(10, 280, 132, 14);
		add(lblEmailPriv);
		
		tfEmailPriv = new JTextField();
		tfEmailPriv.setColumns(10);
		tfEmailPriv.setBounds(120, 280, 140, 20);
		add(tfEmailPriv);
		
		JLabel lblAnrede = new JLabel("Anrede");
		lblAnrede.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblAnrede.setBounds(10, 50, 106, 14);
		add(lblAnrede);
		
		tfAnrede = new JTextField();
		tfAnrede.setColumns(10);
		tfAnrede.setBounds(120, 50, 140, 20);
		add(tfAnrede);
				
		JLabel lblMobil = new JLabel("Mobil");
		lblMobil.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblMobil.setBounds(10, 250, 132, 14);
		add(lblMobil);
		
		tfMobil = new JTextField();
		tfMobil.setColumns(10);
		tfMobil.setBounds(120, 250, 140, 20);
		add(tfMobil);
		
		JLabel lblEmailGesch = new JLabel("E-Mail gesch\u00E4ftlich");
		lblEmailGesch.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblEmailGesch.setBounds(10, 310, 114, 14);
		add(lblEmailGesch);
		
		tfEmailGesch = new JTextField();
		tfEmailGesch.setColumns(10);
		tfEmailGesch.setBounds(120, 310, 140, 20);
		add(tfEmailGesch);
		
		JLabel lblGeb = new JLabel("Geburtsdatum");
		lblGeb.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblGeb.setBounds(10, 140, 132, 14);
		add(lblGeb);
		
		tfGeb = new JTextField();
		tfGeb.setColumns(10);
		tfGeb.setBounds(120, 140, 140, 20);
		add(tfGeb);
		
		JLabel lblGeschInfo = new JLabel("Gesch\u00E4ftsinformationen");
		lblGeschInfo.setFont(new Font("Lucida Sans", Font.BOLD, 12));
		lblGeschInfo.setBounds(310, 24, 150, 14);
		add(lblGeschInfo);
		
		JLabel lblAktivitaet = new JLabel("Aktivit\u00E4t");
		lblAktivitaet.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblAktivitaet.setBounds(310, 80, 106, 14);
		add(lblAktivitaet);
		
		JLabel lblStatus = new JLabel("Status");
		lblStatus.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblStatus.setBounds(310, 230, 106, 14);
		add(lblStatus);
		
		JLabel lblPreis = new JLabel("Preisvorstellung");
		lblPreis.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblPreis.setBounds(310, 50, 202, 14);
		add(lblPreis);
		
		tfPreis = new JTextField();
		tfPreis.setColumns(10);
		tfPreis.setBounds(440, 50, 140, 20);
		add(tfPreis);
	
		JLabel lblStraeNr = new JLabel("Stra\u00DFe, Nr.");
		lblStraeNr.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblStraeNr.setBounds(10, 360, 86, 14);
		add(lblStraeNr);
		
		tfStr = new JTextField();
		tfStr.setColumns(10);
		tfStr.setBounds(120, 360, 95, 20);
		add(tfStr);
		
		tfNr = new JTextField();
		tfNr.setColumns(10);
		tfNr.setBounds(220, 360, 40, 20);
		add(tfNr);
		
		JLabel lblPlzOrt = new JLabel("PLZ, Ort");
		lblPlzOrt.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblPlzOrt.setBounds(10, 390, 86, 14);
		add(lblPlzOrt);
		
		tfOrt = new JTextField();
		tfOrt.setColumns(10);
		tfOrt.setBounds(165, 390, 95, 20);
		add(tfOrt);
		
		tfPLZ = new JTextField();
		tfPLZ.setColumns(10);
		tfPLZ.setBounds(120, 390, 40, 20);
		add(tfPLZ);
		
		JLabel lblLand = new JLabel("Land");
		lblLand.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblLand.setBounds(10, 420, 86, 14);
		add(lblLand);
		
		tfLand = new JTextField();
		tfLand.setColumns(10);
		tfLand.setBounds(120, 420, 140, 20);
		add(tfLand);
		
		JLabel lblLetzterKontakt = new JLabel("Letzter Kontakt");
		lblLetzterKontakt.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblLetzterKontakt.setBounds(310, 170, 120, 14);
		add(lblLetzterKontakt);
				
		JScrollPane spLetzterKontakt = new JScrollPane();
		spLetzterKontakt.setBounds(440, 170, 140, 50);
		add(spLetzterKontakt);
		
		tpLetzterKontakt = new JTextPane();
		spLetzterKontakt.setViewportView(tpLetzterKontakt);
		
		JLabel lblSontiges = new JLabel("Sonstiges");
		lblSontiges.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		lblSontiges.setBounds(310, 110, 106, 14);
		add(lblSontiges);
		
		JScrollPane spSonstiges = new JScrollPane();
		spSonstiges.setBounds(440, 110, 140, 50);
		add(spSonstiges);
		
		tpSonstiges = new JTextPane();
		spSonstiges.setViewportView(tpSonstiges);
		
		JLabel label = new JLabel("Status");
		label.setFont(new Font("Lucida Sans", Font.PLAIN, 11));
		label.setBounds(310, 260, 106, 14);
		add(label);
		
		JScrollPane spStatus = new JScrollPane();
		spStatus.setBounds(440, 260, 140, 100);
		add(spStatus);
		
		tpStatus = new JTextPane();
		spStatus.setViewportView(tpStatus);
		
		comboBoxstatus = new JComboBox();
		comboBoxstatus.setBounds(440, 230, 140, 20);
		add(comboBoxstatus);
		for(String i : SQL_Abfragen.contentstatusArray()){
			comboBoxstatus.addItem(i);
			}
		
		comboBoxaktivitaet = new JComboBox();
		comboBoxaktivitaet.setBounds(440, 80, 140, 20);
		add(comboBoxaktivitaet);
		for(String i : SQL_Abfragen.contentaktivitaetArray()){
			comboBoxaktivitaet.addItem(i);
			}
		
		JSeparator separator = new JSeparator();
		separator.setBounds(10, 40, 250, 14);
		add(separator);
		
		JSeparator separator_1 = new JSeparator();
		separator_1.setBounds(310, 40, 270, 14);
		add(separator_1);
	
	}
	public void fuelleTextFelder(String id) { 

		   ArrayList<String> data = SQL_Abfragen.contentkunde(id);   
		   	tfVorname.setText(data.get(0));
			tfName.setText(data.get(1));
			tfGeb.setText(data.get(2));
			tfTelPrvt.setText(data.get(3));
			tfTelgesch.setText(data.get(4));
			tfMobil.setText(data.get(5));
			tfEmailPriv.setText(data.get(6));
			tfEmailGesch.setText(data.get(7));
			tfStr.setText(data.get(8));
			tfNr.setText(data.get(9));
			tfPLZ.setText(data.get(10));
			tfOrt.setText(data.get(11));
			tfLand.setText(data.get(12));
			tpLetzterKontakt.setText(data.get(13));
			tpStatus.setText(data.get(14));
			tpSonstiges.setText(data.get(15));
			tfPreis.setText(data.get(16));
			
	//		comboBoxaktivitaet.addItem(data.get(13));
	//		comboBoxstatus.
		data.clear();


		     
		}




	public JTextField getTfGeb() {
		return tfGeb;
	}



	public void setTfGeb(JTextField tfGeb) {
		this.tfGeb = tfGeb;
	}



	public JTextField getTfEmailGesch() {
		return tfEmailGesch;
	}



	public void setTfEmailGesch(JTextField tfEmailGesch) {
		this.tfEmailGesch = tfEmailGesch;
	}



	public JTextField getTfEmailPriv() {
		return tfEmailPriv;
	}



	public void setTfEmailPriv(JTextField tfEmailPriv) {
		this.tfEmailPriv = tfEmailPriv;
	}



	public JTextField getTfMobil() {
		return tfMobil;
	}



	public void setTfMobil(JTextField tfMobil) {
		this.tfMobil = tfMobil;
	}



	public JTextField getTfTelgesch() {
		return tfTelgesch;
	}



	public void setTfTelgesch(JTextField tfTelgesch) {
		this.tfTelgesch = tfTelgesch;
	}



	public JTextField getTfTelPrvt() {
		return tfTelPrvt;
	}



	public void setTfTelPrvt(JTextField tfTelPrvt) {
		this.tfTelPrvt = tfTelPrvt;
	}



	public JTextField getTfName() {
		return tfName;
	}



	public void setTfName(JTextField tfName) {
		this.tfName = tfName;
	}



	public JTextField getTfVorname() {
		return tfVorname;
	}



	public void setTfVorname(JTextField tfVorname) {
		this.tfVorname = tfVorname;
	}



	public JTextField getTfAnrede() {
		return tfAnrede;
	}



	public void setTfAnrede(JTextField tfAnrede) {
		this.tfAnrede = tfAnrede;
	}



	public JTextField getTfPreis() {
		return tfPreis;
	}



	public void setTfPreis(JTextField tfPreis) {
		this.tfPreis = tfPreis;
	}



	public JTextField getTfOrt() {
		return tfOrt;
	}



	public void setTfOrt(JTextField tfOrt) {
		this.tfOrt = tfOrt;
	}



	public JTextField getTfPLZ() {
		return tfPLZ;
	}



	public void setTfPLZ(JTextField tfPLZ) {
		this.tfPLZ = tfPLZ;
	}



	public JTextField getTfNr() {
		return tfNr;
	}



	public void setTfNr(JTextField tfNr) {
		this.tfNr = tfNr;
	}



	public JTextField getTfStr() {
		return tfStr;
	}



	public void setTfStr(JTextField tfStr) {
		this.tfStr = tfStr;
	}



	public JTextField getTfLand() {
		return tfLand;
	}



	public void setTfLand(JTextField tfLand) {
		this.tfLand = tfLand;
	}

	
	
}
